﻿using System;
using System.Runtime.InteropServices;

namespace Caius
{
    [Guid("AB634004-F13D-11D0-A459-004095E1DAEA")]
    [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    public interface IAsyncEvent
    {
        /// <summary>
        /// Установка глубины буфера событий
        /// </summary>
        /// <param name="depth">Глубина буфера</param>
        /// <remarks>
        /// <prototype>
        /// HRESULT SetEventBufferDepth(long lDepth);
        /// </prototype>
        /// </remarks>
        void SetEventBufferDepth(Int32 _Depth);

        /// <summary>
        /// Получение глубины буфера событий
        /// </summary>
        /// <param name="depth">Глубина буфера</param>
        /// <remarks>
        /// <prototype>
        /// HRESULT GetEventBufferDepth(long *plDepth);
        /// </prototype>
        /// </remarks>
        void GetEventBufferDepth(ref Int32 _Depth);

        /// <summary>
        /// Посылка события
        /// </summary>
        /// <param name="source">Источник</param>
        /// <param name="message">Сообщение</param>
        /// <param name="data">Данные</param>
        /// <remarks>
        /// <prototype>
        /// HRESULT GetEventBufferDepth(long *plDepth);
        /// </prototype>
        /// </remarks>
        void ExternalEvent(
            [MarshalAs(UnmanagedType.BStr)] String _Source,
            [MarshalAs(UnmanagedType.BStr)] String _Message,
            [MarshalAs(UnmanagedType.BStr)] String _Data
        );

        /// <summary>
        /// Очистка буфера событий
        /// </summary>
        /// <remarks>
        /// <prototype>
        /// </prototype>
        /// </remarks>
        void CleanBuffer();
    }
}
